<?php

namespace common\models\shop;

use Yii;

/**
 * This is the model class for table "shop_cart".
 *
 * @property string $id
 * @property integer $goodsid
 * @property string $from_user
 * @property string $total
 * @property integer $optionid
 * @property string $productprice
 */
class ShopCart extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'shop_cart';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['goodsid', 'openid', 'total'], 'required'],
            [['goodsid', 'total', 'optionid'], 'integer'],
            [['productprice'], 'number'],
            [['from_user'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'goodsid' => 'Goodsid',
            'openid' => 'From User',
            'total' => 'Total',
            'optionid' => 'Optionid',
            'productprice' => 'Productprice',
        ];
    }
}
